package lesson05;

public class Student {
    private String name;
    private String gender;
    private int age;

    public int getAge(){
        return this.age;
    }
    public void setAge(int age){
        if(age >= 18 && age <= 30){
            this.age = age;
        }else{
            System.out.println("对不起，年龄超过限制");
        }

    }
}
